/// 通用返回类
class BaseResult {
  /// 返回数据bean
  dynamic data;

  /// 状态码
  int code;

  /// 返回信息
  String msg;


  bool get isSuccess=>code==0;

  BaseResult({this.data, required this.code, this.msg=""});

  factory BaseResult.fromJson(Map<String, dynamic> json) => BaseResult(
    code: json["code"],
    data: json.containsKey("rows")?json["rows"]:(json["data"]??{}) ,
    msg: json["msg"]??"",
  );

  Map<String, dynamic> toJson() => {
    "code": code,
    "data": data.toJson(),
    "msg": msg,
  };
}